package cn.com.miao.lynx.rpc.grpc.starter.service;

import cn.com.miao.lynx.rpc.grpc.starter.GrpcService;
import com.google.protobuf.ByteString;

/**
 * SerializeService
 * 序列化服务
 * @title: SerializeService
 * @description:
 * @author: dengmiao
 * @create: 2019-12-25 15:40
 **/
public interface SerializeService {

    /**
     * 序列化
     */
    ByteString serialize(GrpcResponse response);

    /**
     * 序列化
     */
    ByteString serialize(GrpcRequest request);

    /**
     * 反序列化
     */
    GrpcRequest deserialize(GrpcService.Request request);

    /**
     * 反序列化
     */
    GrpcResponse deserialize(GrpcService.Response response);
}
